<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>验证码页面</title>
</head>
<body>
<form action="/WebTest/CheckCode">
    <p>验证码<input type="text" name="code">
        <img src="checkImg">
        <a href="javascript:void(0)" class="get_code">看不清?换一张</a>
    </p>
    <button type="submit">提交</button>


    <script>
        let a = document.querySelector(".get_code");
        a.addEventListener('click',function(){
            document.querySelector('img').src = '/WebTest/checkImg?'+Math.random();
        })
    </script>
</form>
</body>
</html>